package com.bskj.bms.bean.vo;

import java.util.List;

import com.bskj.common.bean.model.ParkingShop;
import com.bskj.common.bean.model.ShopCoupon;

public class ShopListVo{
	private Integer id;
	private String couponLimit;
	private String name;
    private String location;
    private String ownerName;
    private String phone;
    private Integer status;
    private String couponMonney;
    
    
	public String getCouponMonney() {
		return couponMonney;
	}

	public void setCouponMonney(String couponMonney) {
		this.couponMonney = couponMonney;
	}

	public String getCouponLimit() {
		return couponLimit;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getLocation() {
		return location;
	}

	public void setLocation(String location) {
		this.location = location;
	}

	public String getOwnerName() {
		return ownerName;
	}

	public void setOwnerName(String ownerName) {
		this.ownerName = ownerName;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public void setCouponLimit(String couponLimit) {
		this.couponLimit = couponLimit;
	}
	
	public ShopListVo getShopListVo(ParkingShop parkingShop,List<ShopCoupon> shopCoupons) {
		ShopListVo shopListVo=new ShopListVo();
		StringBuilder cm=new StringBuilder();
		if(shopCoupons!= null && shopCoupons.size() > 0){
			for (ShopCoupon shopCoupon : shopCoupons) {
				if(shopCoupon.getCouponMoneyType() == 2){
					cm.append("全免/");
				}else {
					cm.append(shopCoupon.getMoney()/10+"元/");
				}
			}
			shopListVo.setCouponMonney(cm.toString().substring(0, cm.length()-1));
		}else {
			shopListVo.setCouponMonney("没有设置停车券");
		}
		
		
		shopListVo.setId(parkingShop.getId());
		shopListVo.setName(parkingShop.getName());
		shopListVo.setLocation(parkingShop.getLocation());
		shopListVo.setOwnerName(parkingShop.getOwnerName());
		shopListVo.setPhone(parkingShop.getPhone());
		shopListVo.setStatus(parkingShop.getStatus());
		return shopListVo;
	}
}
